/* -------------------- RESET & BASE -------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Roboto, system-ui, -apple-system, sans-serif;
}

body {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* -------------------- CUSTOM SCROLLBAR -------------------- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* -------------------- SIDEBAR -------------------- */
.sidebar {
    width: 260px;
    background: #ffffff;
    backdrop-filter: blur(10px);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.03);
    padding: 28px 20px;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.2s ease;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-left: 4px;
}

.logo-icon {
    background: linear-gradient(135deg, #e53e3e, #c53030);
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 4px 8px rgba(229, 62, 62, 0.2);
}

.logo-text {
    font-weight: 700;
    font-size: 1.2rem;
    background: linear-gradient(135deg, #2d3748, #1a202c);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    border-radius: 14px;
    color: #4a5568;
    margin-bottom: 6px;
    transition: all 0.2s ease;
    cursor: default;
    font-weight: 500;
}

.nav-item i {
    width: 24px;
    font-size: 1.2rem;
    color: #718096;
    transition: color 0.2s;
}

.nav-item.active {
    background: linear-gradient(95deg, #fef2f2, #fff5f5);
    color: #c53030;
    box-shadow: 0 2px 6px rgba(229, 62, 62, 0.08);
}

.nav-item.active i {
    color: #c53030;
}

.nav-item:not(.active):hover {
    background: #f8fafc;
    transform: translateX(4px);
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid #eef2f6;
    padding-top: 24px;
}

.sidebar-footer .nav-item a {
    text-decoration: none;
    color: inherit;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

/* -------------------- MAIN CONTENT -------------------- */
.main-content {
    flex: 1;
    overflow-y: auto;
    padding: 28px 36px;
    background: #f8fafc;
}

/* -------------------- TOP BAR -------------------- */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.page-title h1 {
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(135deg, #1e293b, #0f172a);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.02em;
}

.page-title p {
    color: #64748b;
    font-size: 0.9rem;
    margin-top: 6px;
    font-weight: 500;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 24px;
}

.notification-badge {
    position: relative;
    font-size: 1.5rem;
    color: #475569;
    cursor: pointer;
    transition: color 0.2s, transform 0.2s;
}

.notification-badge:hover {
    color: #e53e3e;
    transform: scale(1.05);
}

.notification-badge[data-count]:after {
    content: attr(data-count);
    position: absolute;
    top: -8px;
    right: -10px;
    background: linear-gradient(135deg, #e53e3e, #b91c1c);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 30px;
    min-width: 18px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.avatar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    padding: 6px 14px 6px 8px;
    border-radius: 60px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02), 0 0 0 1px #edf2f7;
    transition: all 0.2s;
    cursor: pointer;
}

.avatar:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05), 0 0 0 1px #e2e8f0;
}

.avatar-img {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    border-radius: 50%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="%234a5568"><path d="M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"/></svg>');
    background-size: 55%;
    background-position: center 55%;
    background-repeat: no-repeat;
    background-color: #edf2f7;
}

.avatar-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 0.9rem;
}

/* -------------------- KPI CARDS -------------------- */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    margin-bottom: 36px;
}

.kpi-card {
    background: white;
    padding: 20px 24px;
    border-radius: 24px;
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.04);
    border: 1px solid #edf2f7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.25s ease;
    backdrop-filter: blur(2px);
}

.kpi-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 24px -8px rgba(0, 0, 0, 0.08);
    border-color: #e2e8f0;
}

.kpi-info h3 {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.kpi-number {
    font-size: 2rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.kpi-icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, #fef2f2, #fff5f5);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #e53e3e;
    font-size: 26px;
    transition: all 0.2s;
}

.kpi-card:hover .kpi-icon {
    transform: scale(1.05);
    background: linear-gradient(135deg, #ffe6e6, #fff0f0);
}

/* -------------------- TWO COLUMN GRID -------------------- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 28px;
    margin-bottom: 28px;
}

/* -------------------- CARDS -------------------- */
.card {
    background: white;
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.04);
    border: 1px solid #edf2f7;
    transition: all 0.2s ease;
}

.card:hover {
    border-color: #e2e8f0;
    box-shadow: 0 12px 28px -12px rgba(0, 0, 0, 0.08);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 8px;
    border-bottom: 2px solid #f1f5f9;
}

.card-header h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.2px;
}

.card-header a {
    color: #e53e3e;
    font-size: 0.8rem;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.card-header a:hover {
    color: #b91c1c;
    text-decoration: underline;
}

/* -------------------- APPOINTMENTS -------------------- */
.appointment-item {
    display: flex;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.2s;
}

.appointment-item:hover {
    background: #fef9f9;
    margin-left: -8px;
    margin-right: -8px;
    padding-left: 8px;
    padding-right: 8px;
    border-radius: 16px;
}

.appointment-item:last-child {
    border-bottom: none;
}

.appointment-date {
    background: linear-gradient(135deg, #fef2f2, #fff5f5);
    color: #b91c1c;
    font-weight: 700;
    width: 56px;
    height: 56px;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1.2;
    margin-right: 18px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
}

.appointment-date .day {
    font-size: 1.3rem;
    font-weight: 800;
}

.appointment-date .month {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.appointment-details {
    flex: 1;
}

.appointment-details h4 {
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 4px;
    font-size: 1rem;
}

.appointment-details p {
    color: #64748b;
    font-size: 0.75rem;
}

.appointment-status {
    background: #eef2ff;
    color: #1e40af;
    font-size: 0.7rem;
    padding: 4px 10px;
    border-radius: 40px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* -------------------- DONATION HISTORY TABLE -------------------- */
.history-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.history-table th {
    text-align: left;
    font-size: 0.7rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 14px;
}

.history-table td {
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    color: #334155;
    font-weight: 500;
}

.history-table tr:last-child td {
    border-bottom: none;
}

.badge-success {
    background: #e0f2e9;
    color: #2b6e3b;
    padding: 4px 10px;
    border-radius: 40px;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

/* -------------------- BLOOD STOCK -------------------- */
.blood-stock-list {
    margin-top: 8px;
}

.blood-type-row {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
    transition: all 0.2s;
}

.blood-type-row:hover {
    transform: translateX(4px);
}

.blood-type {
    font-weight: 700;
    width: 48px;
    color: #1e293b;
    font-size: 0.9rem;
}

.stock-bar-container {
    flex: 1;
    height: 8px;
    background: #eef2f6;
    border-radius: 20px;
    margin: 0 14px;
    overflow: hidden;
}

.stock-bar {
    height: 100%;
    border-radius: 20px;
    background: linear-gradient(90deg, #e53e3e, #b91c1c);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.2, 0.9, 0.4, 1.1);
}

.stock-value {
    color: #475569;
    font-size: 0.8rem;
    font-weight: 500;
    min-width: 70px;
    text-align: right;
}

/* -------------------- URGENT REQUESTS -------------------- */
.urgent-requests {
    margin-top: 16px;
    background: #fffbfb;
    padding: 20px;
    border-radius: 24px;
    border: 1px solid #fee2e2;
}

.urgent-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 8px 0;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 12px;
}

.urgent-item:hover {
    background: #fff5f5;
    padding-left: 8px;
    padding-right: 8px;
    margin-left: -8px;
    margin-right: -8px;
}

.urgent-item span:first-child {
    font-weight: 600;
    color: #1e293b;
}

.urgent-item span:last-child {
    color: #b91c1c;
    font-weight: 700;
    background: #fee2e2;
    padding: 2px 8px;
    border-radius: 30px;
    font-size: 0.75rem;
}

/* -------------------- QUICK TIP -------------------- */
.quick-tip {
    margin-top: 24px;
    background: linear-gradient(135deg, #fef6f6, #fff9f9);
    border-radius: 24px;
    padding: 20px;
    border-left: 5px solid #e53e3e;
    transition: all 0.2s;
}

.quick-tip:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.08);
}

.quick-tip h4 {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 6px;
    color: #1e293b;
}

.quick-tip p {
    color: #475569;
    font-size: 0.8rem;
    line-height: 1.4;
    margin-bottom: 12px;
}

#bookSlotBtn {
    background: linear-gradient(135deg, #e53e3e, #b91c1c);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 40px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(229, 62, 62, 0.2);
}

#bookSlotBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(229, 62, 62, 0.3);
    background: linear-gradient(135deg, #c53030, #9b2c2c);
}

/* -------------------- RESPONSIVE DESIGN -------------------- */
@media (max-width: 1200px) {
    .kpi-grid {
        gap: 18px;
    }
    .kpi-number {
        font-size: 1.6rem;
    }
}

@media (max-width: 1100px) {
    .kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .dashboard-grid {
        gap: 20px;
    }
}

@media (max-width: 800px) {
    body {
        flex-direction: column;
        overflow: auto;
    }
    .sidebar {
        width: 100%;
        flex-direction: row;
        overflow-x: auto;
        padding: 16px 20px;
        gap: 20px;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        backdrop-filter: none;
    }
    .logo-area {
        margin-bottom: 0;
        margin-right: 20px;
    }
    .nav-item {
        white-space: nowrap;
        margin-bottom: 0;
    }
    .sidebar-footer {
        display: none;
    }
    .main-content {
        padding: 20px;
    }
    .dashboard-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    .kpi-grid {
        gap: 16px;
    }
    .kpi-card {
        padding: 16px;
    }
    .card {
        padding: 20px;
    }
    .appointment-item:hover {
        margin-left: 0;
        margin-right: 0;
    }
}

@media (max-width: 480px) {
    .kpi-grid {
        grid-template-columns: 1fr;
    }
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .user-profile {
        align-self: flex-end;
    }
    .page-title h1 {
        font-size: 1.5rem;
    }
}